Skip to content

feat(plugins): manual-pages flow — manpage seed schema, flow docs, verification fixes#971

Merged
phernandez merged 7 commits into
mainfrom
feat/manual-pages-952
Jun 11, 2026
Merged

feat(plugins): manual-pages flow — manpage seed schema, flow docs, verification fixes#971
phernandez merged 7 commits into
mainfrom
feat/manual-pages-952

Conversation

@phernandez

Copy link
Copy Markdown
Member

Summary

The repo-side half of #952: the manual-pages flow. The manual itself is live as the manual project in the Basic Memory team workspace — 38 pages + the Manpage schema, validating 38/38, every example executed against the live service before its page shipped (MCP path = deployed cloud, CLI path = this checkout). This PR lands what belongs in the repo:

Why building docs this way is worth it

The verification discipline doubled as a live end-to-end smoke test and found six bugs in one pass: #954 (workspace selector silently dropped on create), #955 ([[None]] forward refs in build_context), #956 (workspace project index never refreshes on miss), #957 (folder/* patterns dead on cloud projects), #958 (fixed here), #959 (CLI-only local sync dead end). Fixes for the routing-layer issues (#954/#956/#957) and #955 are specced in their issues as follow-ups.

Verification

  • pytest tests/mcp/test_tool_cloud_discovery.py -v — 2 passed (regression test asserts substitution)
  • just lint / just typecheck — clean
  • just package-check-claude-code — plugin + seed schemas validate
  • Manual itself: bm tool schema-validate manpage --project manual → 38/38 valid; bm orphans --project manual → no disconnected pages

Refs #952.

🤖 Generated with Claude Code

phernandez and others added 4 commits June 11, 2026 01:04
The bundled markdown for both tools carries a {{OSS_DISCOUNT_CODE}}
placeholder, and the tools returned it verbatim — users saw the literal
template string. The prior test asserted the placeholder, pinning the bug.

Substitute the code from cli.promo (single source of truth) on read, and
assert that no template braces ever reach tool output.

Fixes #958. Found during live verification for #952.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: phernandez <paul@basicmachines.co>
…ch total semantics

- README, Docker guide, and character-handling guide referenced
  'basic-memory sync', which no longer exists; point them at
  'basic-memory reindex' (the incremental filesystem scan) instead.
  Part of #959.
- Document in the search_notes docstring that vector/hybrid searches
  report total: 0 by design (no second counting pass) and that has_more
  is the pagination signal in those modes.

Found during live verification for #952.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: phernandez <paul@basicmachines.co>
Picoschema for Unix-style manual pages as Basic Memory notes (#952):
section/name/summary/verified frontmatter contracts, gotcha/bug/pattern
observation categories, see_also relations. Opt-in seed — not wired into
bm-setup's default seeding; documentation projects adopt it explicitly.
Validated by just package-check-claude-code.

The first consumer is the 'manual' project in the Basic Memory team
workspace: 38 pages validating 38/38 against this schema.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: phernandez <paul@basicmachines.co>
What the manual is (notes conforming to the Manpage schema, SEE ALSO as
relations), where it lives (team-workspace 'manual' project; opt-in seed
schema for any project), the verification discipline (examples must run,
playground rule, verified stamps, schema-validate as linter), how to add
pages, and the generator/bm-man roadmap.

Part of #952.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: phernandez <paul@basicmachines.co>
Review feedback on #971:
- cloud_info and release_notes duplicated the read-and-substitute logic
  and its rationale comment; both now call
  resources.discovery.load_discovery_resource(), the single place that
  renders promo placeholders (and the single place to extend when more
  placeholders land)
- character-handling doc claimed reindex 'reports conflicts'; it handles
  them during the scan but emits no conflict report — say what it does

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: phernandez <paul@basicmachines.co>
@phernandez

Copy link
Copy Markdown
Member Author

Self-review (high effort) — findings and resolutions

Ran a 7-angle review pass over the diff (line-by-line, removed-behavior, cross-file tracing, reuse, simplification, efficiency, altitude). Resolutions:

Fixed in 97ee1d1:

  • Duplicationcloud_info and release_notes had identical read-and-substitute bodies and identical rationale comments. Extracted mcp/resources/discovery.load_discovery_resource(): the package that owns the markdown owns its rendering, and future placeholders get substituted in exactly one place.
  • Doc overclaimdocs/character-handling.md said bm reindex "reports conflicts"; it handles conflicts during the scan but emits no conflict report in CLI output. Reworded to match actual behavior.

Considered and rejected:

  • Fallback to raw markdown if the promo import fails — a same-package import failing means a broken install; failing loudly beats silently shipping the placeholder (which is the original bug). House style is fail-fast.
  • "assert "{{" not in result misses newly added placeholders" — factually wrong: any unsubstituted {{...}} trips that assertion; it's exactly the inventory check.
  • Docs/schema-body overlap between docs/manual-pages.md and the seed schema — intentional: the seed gets copied into Basic Memory projects where repo-relative links are dead, so it must stand alone.
  • Parameterizing the two discovery tests — two near-identical 5-line tests are clearer than one parameterized indirection at this scale.

Cross-file checks came back clean: the lazy cli.promo import is a side-effect-free constant; the plugin validator and bm-setup seed list are name-based, so the fourth schema file changes nothing; no consumer of the search_notes docstring breaks.

🤖 Generated with Claude Code

phernandez and others added 2 commits June 11, 2026 12:32
First slice of #610, grown out of the #952 manual work:

- src/basic_memory/man/bm.1: hand-written groff overview page (content
  from the verified bm(1) manual note), plus basic-memory.1 as a .so alias
- 'bm man install [--dir]' copies the bundled pages to a man root
  (default ~/.local/share/man, which manpath(1) derives from ~/.local/bin
  on PATH on both man-db and BSD man); warns with a one-line MANPATH fix
  when the root is provably unsearched, stays quiet when manpath is
  unavailable
- verified end-to-end: 'man -M <root> bm' renders, alias resolves
- docs/manual-pages.md: lay out the Unix section numbering (1-8, with
  examples and the crontab(1)/crontab(5) story), document man bm usage,
  update the roadmap

Agents with shell access get 'man bm' as an offline quick reference; the
per-tool detail stays in the manual project's section-3 pages.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: phernandez <paul@basicmachines.co>
CI failed because rich wrapped 'not on your manpath' across a line break
at the runner's 80-column width; the substring assertion missed it while
local wider terminals passed. Collapse whitespace before asserting so the
presence and absence checks are immune to wrap position. Verified at
COLUMNS=80 and COLUMNS=40.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: phernandez <paul@basicmachines.co>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bd87ae0e45

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/basic_memory/cli/commands/man.py
@phernandez phernandez merged commit a148e72 into main Jun 11, 2026
29 checks passed
@phernandez phernandez deleted the feat/manual-pages-952 branch June 11, 2026 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cloud_info and release_notes return unsubstituted {{OSS_DISCOUNT_CODE}} placeholder

1 participant